$j(document).ready(function(){
		$j("#checkAll").click(function(event){
			if($j(this).attr("checked")){
				var che = $j(".check_allChild").find("input[type='checkbox']");
				che.attr({checked : 'checked'});
			}else{
				var che = $j(".check_allChild").find("input[type='checkbox']");
				che.attr({checked : ''});
			}
		});
		
		$j("#messageDelete").click(function(){
			var che = $j(".check_allChild").find("input[type='checkbox']");
			var n = 0;
			var messageIds = "";
			che.each(function(){
				if($j(this).attr("checked")){
					messageIds+= $j(this).val() + ",";
					n++;
				}
			});
			if(n>0){
				messageIds = messageIds.substring(0,messageIds.length - 1);
				if(confirm("你确认要删除"+n+"条记录吗？")){
					window.location.href =__ctxPath+'/customer/csSystemMessages.html?type=N&doAction=delAllMessage&PrmPageNo=${PrmPageNo}&messageIds='+messageIds;
				}
			}else{
				//$j(this).attr({href:'##'});
				alert('请选择要删除的消息！')
			}
		});
		
		
		$j("#checkAllRead").click(function(event){
			if($j(this).attr("checked")){
				var che = $j(".check_read_allChild").find("input[type='checkbox']");
				che.attr({checked : 'checked'});
			}else{
				var che = $j(".check_read_allChild").find("input[type='checkbox']");
				che.attr({checked : ''});
			}
		});
		
		$j("#readMessageDelete").click(function(){
			var che = $j(".check_read_allChild").find("input[type='checkbox']");
			var n = 0;
			var messageIds = "";
			che.each(function(){
				if($j(this).attr("checked")){
					messageIds+= $j(this).val() + ",";
					n++;
				}
			});
			if(n>0){
				messageIds = messageIds.substring(0,messageIds.length - 1);
				if(confirm("你确认要删除"+n+"条记录吗？")){
					window.location.href =__ctxPath+'/customer/csSystemMessages.html?type=A&doAction=delAllMessage&PrmPageNo=${PrmPageNo}&messageIds='+messageIds;
				}
			}else{
				//$j(this).attr({href:'##'});
				alert('请选择要删除的消息！')
			}
		});
	})